<?php

$file   = uploadfile(gpc_getFile('file'),'../'.$path_upload);
$name   = gpc_getStringPost('name');
$status = 1;

if($file)
{
    $sql_insert = "insert tblfiles (cName,cFile,iStatus,cLanguage)
                    values('$name','$file','$status','$language')";
                    
    if($dbsql->query($sql_insert))
    {
        page_transfer("File added done",$pagetr);
    }
    else
    {
        @unlink('../'.$path_upload.$file);
    }
}else
{
    $msg .= $func_err;
}

page_transfer("File could not added. Please try again. ".$func_err,$pagetr);